<template>
  <div class="dialog">
    <div class="dialog-con editCooperation">
      <split-vertical title="更新授权产品详情"></split-vertical>
        <el-form   label-width="140px" inline>
          <el-form-item label="供应商名称" prop='brandCode'>
            <el-input v-model="cooperationData.supplyName" disabled></el-input>
          </el-form-item>
          <el-form-item label="供应商商品货号" prop='brandCode'>
              <el-input v-model="cooperationData.supplyItemCode"></el-input>
          </el-form-item>
          <el-form-item label="品牌" prop='brandName'>
            <el-input v-model="cooperationData.brandName"></el-input>
          </el-form-item>
           <el-form-item label="商品sku名称" prop='brandCode'>
              <el-input v-model="cooperationData.itemSkuName" disabled></el-input>
          </el-form-item>
          <el-form-item label="进货价(含税含运)" prop='brandCode'>
            <el-input v-model="cooperationData.purchasePrice"></el-input>
          </el-form-item>
        </el-form>
        <div class="btnArr">
          <el-button @click="cancel" size="medium">取消</el-button>
          <el-button @click="confirm" size="medium" type="primary">确定</el-button>
        </div>
    </div>
  </div>
</template>

<script>
  import SplitVertical from "components/common/SplitVertical"
    export default {
      inject:['reload'],
      components:{
        SplitVertical
      },
       data(){
         return {

         }
       },
      props:{
        cooperationData:{
          type:Object,
          default:{}
        }
      },
      methods:{
        cancel(){
          this.$emit("closeTip")
        },
        confirm(){
          let param={
            id:this.cooperationData.id,
            supplyItemCode:this.cooperationData.supplyItemCode,
            purchasePrice:this.cooperationData.purchasePrice
          }
          let success=data=>{
            if(data.code=="OK"){
                this.$message.success("更改成功")
                this.$emit("closeTip")
              this.reload()
            }else{
                this.$message.error(data.msg)
            }
          }
          this.api.productItemUpdate(param,success)
        }
      }
    }
</script>

<style scoped lang="scss">
.editCooperation{
  width:500px;
  height:400px;
  p{
    line-height: 50px;
    text-indent:20px;
  }
  .btnArr{
    padding-top:5px;
    width:100%;
    text-align:center;
  }
  .el-input{
    width:300px;
  }
}
</style>
